package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @program: cloud2020
 * @description: TODO
 * @author: YuWenYi
 * @create: 2021-04-13 12:13
 **/
@Configuration
public class ApplicationContextConfig {
    //处理RPC/RMI的工具类
    @Bean
    @LoadBalanced   //使用轮询的负载均衡方式处理请求
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
